package com.pgytesting.secondhandcar.controller.controller;

import com.pgytesting.secondhandcar.vo.ResponseMessage;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * @author : frosty0804@gmail.com
 * @version : v1.0
 * @projectName : secondhandcar
 * @className : NotLoginController
 * @description : TODO(一句话描述该类的功能)
 * @date : 2019/8/16 16:05
 */
@RestController
public class NotLoginController {


    @RequestMapping("/isLogin")
    public ResponseMessage notLogin() {
        return ResponseMessage.errorResponse("登录信息验证失败，请登录", 401);
    }


    @RequestMapping(value = "/loginOut")
    public ResponseMessage loginOut(HttpSession session) {
        session.removeAttribute("user");
        session.removeAttribute("login");
        return ResponseMessage.successResponse("退出登录成功");
    }


}
